package cn.iocoder.yudao.module.social.convert.interaction;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.social.api.interaction.dto.InteractionReqDTO;
import cn.iocoder.yudao.module.social.api.interaction.dto.InteractionRespDTO;
import cn.iocoder.yudao.module.social.controller.admin.interaction.vo.InteractionCreateReqVO;
import cn.iocoder.yudao.module.social.controller.admin.interaction.vo.InteractionRespVO;
import cn.iocoder.yudao.module.social.dal.dataobject.interaction.InteractionDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 互动 Convert
 *
 * @author 芋道源码
 */
@Mapper
public interface InteractionConvert {

    InteractionConvert INSTANCE = Mappers.getMapper(InteractionConvert.class);

    @Mapping(target = "id", ignore = true)
    InteractionDO convert(InteractionCreateReqVO bean);

    InteractionRespVO convert(InteractionDO bean);

    List<InteractionRespVO> convertList(List<InteractionDO> list);

    PageResult<InteractionRespVO> convertPage(PageResult<InteractionDO> page);

    // API 转换方法
    InteractionRespDTO convertApi(InteractionDO bean);

    List<InteractionRespDTO> convertApiList(List<InteractionDO> list);

    InteractionCreateReqVO convertToCreateReqVO(InteractionReqDTO bean);

}
